package com.qfmy.controller.common;

import com.qfmy.service.common.AddressService;
import common.result.Result;
import jakarta.annotation.Resource;
import model.entity.common.Address;
import model.query.AddressQuery;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 清风明月
 * @Package com.qfmy.controller.common
 * @date 2025/5/18
 * @description 地址
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/address")
public class AddressController {

    /**
     * 注入service
     */
    @Resource
    private AddressService addressService;



    /**
     * 添加地址
     */
    @RequestMapping("/addAddress")
    public Result<String> addAddress(@RequestBody AddressQuery addressQuery) {
        addressService.addAddress(addressQuery);
        return Result.ok("添加成功");
    }

    /**
     *获取地址
     */
    @RequestMapping("/getAddress")
    public Result<Address> getAddress() {
        return Result.ok(addressService.getAddress());
    }

}
